const path = require('path');
const fpath = 'a/b/c/d/index.html';

console.log(path.basename(fpath));
console.log(path.basename(fpath,'.html'));
console.log(path.extname(fpath));